@echo off

if %JDK_HOME%.==. goto SETHOME

echo Compiling...
%JDK_HOME%\bin\javac -target 1.1 -classpath .;..\..\lib\javax.jar -bootclasspath ..\..\lib\java.jar *.java
if errorlevel==1 goto ERROR

echo Linking...
set CLASSPATH=..\..\lib\ClassLinker.jar
%JDK_HOME%\bin\java ClassLinker -f MyApp
if errorlevel==1 goto ERROR

cd native
re make native code
cd ..
if errorlevel==1 goto ERROR
goto EXIT

:ERROR
echo Build failed
goto EXIT

:SETHOME
echo Missing JDK_HOME environment variable. For example: SET JDK_HOME=C:\JDK1.3

:EXIT
pause



